John Temples wrote:
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Fri, 2 Jul 2004 21:55:41 +0000 (21:55 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Fri, 2 Jul 2004 21:55:41 +0000 (21:55 +0000)
> This patch makes the definition of "duplicate" ignore case.  Mapsource
> doesn't like waypoints with the same name in different case.
>

gpsbabel/netstumbler.c

index 8faf7d9438c3c153094e46f672b2b16cbc61b123..699c638654c1daa2f3f6d3ea675bd6c4b9cfee39 100644 (file)
@@ -241,6 +241,7 @@ fix_netstumbler_dupes(void)
        queue *elem, *tmp;
        extern queue waypt_head;
        const char *snptr;
+       char *tmp_sn, *tmp_ptr;
        unsigned long last_crc;
        char ssid[32 + 5 + 1];
 
@@ -251,7 +252,11 @@ fix_netstumbler_dupes(void)
        QUEUE_FOR_EACH(&waypt_head, elem, tmp) {
                bh->wpt = (waypoint *) elem;
                snptr = bh->wpt->shortname;
-               bh->crc = get_crc32(snptr, strlen(snptr));
+               tmp_sn = xstrdup(snptr);
+               for (tmp_ptr = tmp_sn; *tmp_ptr; tmp_ptr++)
+                       *tmp_ptr = tolower(*tmp_ptr);
+               bh->crc = get_crc32(tmp_sn, strlen(snptr));
+               xfree(tmp_sn);
                i ++;
                bh ++;
        }